Change in openvpn[master]: add flag to print mroute_addr address family
A message that is not in the archive (sent off-list or not yet received): gerrit.1752849659000.I43cd3d564d8c6ad4e41de5a38130d90cb6778395@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
to review the following change.
Change subject: add flag to print mroute_addr address family
......................................................................
add flag to print mroute_addr address family
Add the MAPF_SHOW_FAMILY flag to prepend the address family to the address when printing an mroute_addr object, similar to how it's done in print_sockaddr_ex().
Note that when using this flag with an IPv4-mapped IPv6 address, the output will look like: [AF_INET6]a.b.c.d
---
M src/openvpn/mroute.c
M src/openvpn/mroute.h
2 files changed, 9 insertions(+), 0 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/92/1092/1
src/openvpn/mroute.c +8 -0
@@ -415,6 +415,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET]" ); + }buf_printf (&out,"%s" ,print_in_addr_t (ntohl (maddr.v4.addr), (flags &MAPF_IA_EMPTY_IF_UNDEF ) ?IA_EMPTY_IF_UNDEF :0 , gc));if (maddr.type &MR_WITH_NETBITS )
@@ -442,6 +446,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET6 , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET6]" ); + }if (IN6_IS_ADDR_V4MAPPED ( &maddr.v6.addr ) ) { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr,
src/openvpn/mroute.h +1 -0
@@ -150,6 +150,7 @@#define MAPF_SUBNET (1<<0)#define MAPF_IA_EMPTY_IF_UNDEF (1<<1)#define MAPF_SHOW_ARP (1<<2) +#define MAPF_SHOW_FAMILY (1<<3)const char *mroute_addr_print_ex (const struct mroute_addr *ma,const unsigned int flags,struct gc_arena *gc);
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: flichtenheld, plaisthos, ralf_lici.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email )
Change subject: add flag to print mroute_addr address family
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
I'm not really sure I understand this patch - nobody is using that new flag yet, so it's a bit of a no-op...?
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: cron2 <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ralf_lici <[email protected]...>
Gerrit-Comment-Date: Fri, 18 Jul 2025 20:45:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: cron2, flichtenheld, plaisthos.
ralf_lici has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email )
Change subject: add flag to print mroute_addr address family
......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
Quoted 1 line
I'm not really sure I understand this patch - nobody is using that new flag yet, so it's a bit of a […]
ACK
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: cron2 <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 18 Jul 2025 20:55:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment
[Openvpn-devel] [S] Change in openvpn[master]: add flag to print addresses in a consistent format during float
In reply to a message not in the archiveAttention is currently required from: cron2, flichtenheld, plaisthos.
Hello flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
to look at the new patch set (#2).
Change subject: add flag to print addresses in a consistent format during float
......................................................................
add flag to print addresses in a consistent format during float
Introduce the MAPF_SHOW_FAMILY flag to prepend the address family to the address when printing an mroute_addr object, similar to print_sockaddr_ex(). This ensures that when logging a float operation, both the old and new addresses are printed in the same format:
$proto:[$family]$address:$port.
Note: when using this flag with an IPv4-mapped IPv6 address, the output will appear as: [AF_INET6]a.b.c.d
---
M src/openvpn/mroute.c
M src/openvpn/mroute.h
M src/openvpn/multi.c
3 files changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/92/1092/2
src/openvpn/mroute.c +8 -0
@@ -415,6 +415,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET]" ); + }buf_printf (&out,"%s" ,print_in_addr_t (ntohl (maddr.v4.addr), (flags &MAPF_IA_EMPTY_IF_UNDEF ) ?IA_EMPTY_IF_UNDEF :0 , gc));if (maddr.type &MR_WITH_NETBITS )
@@ -442,6 +446,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET6 , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET6]" ); + }if (IN6_IS_ADDR_V4MAPPED ( &maddr.v6.addr ) ) { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr,
src/openvpn/mroute.h +1 -0
@@ -150,6 +150,7 @@#define MAPF_SUBNET (1<<0)#define MAPF_IA_EMPTY_IF_UNDEF (1<<1)#define MAPF_SHOW_ARP (1<<2) +#define MAPF_SHOW_FAMILY (1<<3)const char *mroute_addr_print_ex (const struct mroute_addr *ma,const unsigned int flags,struct gc_arena *gc);
src/openvpn/multi.c +2 -2
@@ -3274,8 +3274,8 @@msg (D_MULTI_MEDIUM ,"peer %" PRIu32" (%s) floated from %s to %s" , mi->context.c2.tls_multi->peer_id,tls_common_name (mi->context.c2.tls_multi, false), -mroute_addr_print (&mi->real, &gc), -print_link_socket_actual (&m->top.c2.from, &gc)); +mroute_addr_print_ex (&mi->real,MAPF_SHOW_FAMILY , &gc), +mroute_addr_print_ex (&real,MAPF_SHOW_FAMILY , &gc));/* remove old address from hash table before changing address */ ASSERT (hash_remove (m->hash, &mi->real));
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: cron2 <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newpatchset
[Openvpn-devel] [S] Change in openvpn[master]: add flag to print addresses in a consistent format during float
In reply to a message not in the archiveAttention is currently required from: flichtenheld, plaisthos, ralf_lici.
cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email )
Change subject: add flag to print addresses in a consistent format during float
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ralf_lici <[email protected]...>
Gerrit-Comment-Date: Fri, 25 Jul 2025 19:41:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
PATCH v2 1/1 add flag to print addresses in a consistent format during float
In reply to a message not in the archiveFrom: Ralf Lici <[email protected]...>
Introduce the MAPF_SHOW_FAMILY flag to prepend the address family to the address when printing an mroute_addr object, similar to print_sockaddr_ex(). This ensures that when logging a float operation, both the old and new addresses are printed in the same format:
$proto:[$family]$address:$port.
Note: when using this flag with an IPv4-mapped IPv6 address, the output will appear as: [AF_INET6]a.b.c.d
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1092
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
src/openvpn/mroute.c +8 -0
@@ -415,6 +415,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET]" ); + }buf_printf (&out,"%s" ,print_in_addr_t (ntohl (maddr.v4.addr), (flags &MAPF_IA_EMPTY_IF_UNDEF ) ?IA_EMPTY_IF_UNDEF :0 , gc));if (maddr.type &MR_WITH_NETBITS )
@@ -442,6 +446,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET6 , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET6]" ); + }if (IN6_IS_ADDR_V4MAPPED ( &maddr.v6.addr ) ) { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr,
src/openvpn/mroute.h +1 -0
@@ -150,6 +150,7 @@#define MAPF_SUBNET (1<<0)#define MAPF_IA_EMPTY_IF_UNDEF (1<<1)#define MAPF_SHOW_ARP (1<<2) +#define MAPF_SHOW_FAMILY (1<<3)const char *mroute_addr_print_ex (const struct mroute_addr *ma,const unsigned int flags,struct gc_arena *gc);
src/openvpn/multi.c +2 -2
@@ -3274,8 +3274,8 @@msg (D_MULTI_MEDIUM ,"peer %" PRIu32" (%s) floated from %s to %s" , mi->context.c2.tls_multi->peer_id,tls_common_name (mi->context.c2.tls_multi, false), -mroute_addr_print (&mi->real, &gc), -print_link_socket_actual (&m->top.c2.from, &gc)); +mroute_addr_print_ex (&mi->real,MAPF_SHOW_FAMILY , &gc), +mroute_addr_print_ex (&real,MAPF_SHOW_FAMILY , &gc));/* remove old address from hash table before changing address */ ASSERT (hash_remove (m->hash, &mi->real));
[Openvpn-devel] [PATCH applied] Re: add flag to print addresses in a consistent format during float
"Because it makes sense" - as agreed, this still distinguishes between "v4 on a v6 socket" and "v4 on a v4 socket", because for troubleshooting it can make a difference. But having both old and new address printed by the same function in the same format is definitely an improvement :-)
Tested v4 on a v4-only socket, v4+v6 on a dual-stack v6 socket, all looks nice and consistent now. Thanks.
Your patch has been applied to the master branch.
commit 7d5ec053f0f30c6cd27b60ed76859a09f6dbf5e4
Author: Ralf Lici Date: Fri Jul 25 21:41:39 2025 +0200
add flag to print addresses in a consistent format during float
Signed-off-by: Ralf Lici <[email protected]...>
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32345.html
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering
[Openvpn-devel] [S] Change in openvpn[master]: add flag to print addresses in a consistent format during float
In reply to a message not in the archivecron2 has uploaded a new patch set (#3) to the change originally created by ralf_lici. ( http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email )
The following approvals got outdated and were removed:
Code-Review+2 by cron2
Change subject: add flag to print addresses in a consistent format during float
......................................................................
add flag to print addresses in a consistent format during float
Introduce the MAPF_SHOW_FAMILY flag to prepend the address family to the address when printing an mroute_addr object, similar to print_sockaddr_ex(). This ensures that when logging a float operation, both the old and new addresses are printed in the same format:
$proto:[$family]$address:$port.
Note: when using this flag with an IPv4-mapped IPv6 address, the output will appear as: [AF_INET6]a.b.c.d
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32345.html
---
M src/openvpn/mroute.c
M src/openvpn/mroute.h
M src/openvpn/multi.c
3 files changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/92/1092/3
src/openvpn/mroute.c +8 -0
@@ -415,6 +415,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET]" ); + }buf_printf (&out,"%s" ,print_in_addr_t (ntohl (maddr.v4.addr), (flags &MAPF_IA_EMPTY_IF_UNDEF ) ?IA_EMPTY_IF_UNDEF :0 , gc));if (maddr.type &MR_WITH_NETBITS )
@@ -442,6 +446,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET6 , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET6]" ); + }if (IN6_IS_ADDR_V4MAPPED ( &maddr.v6.addr ) ) { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr,
src/openvpn/mroute.h +1 -0
@@ -150,6 +150,7 @@#define MAPF_SUBNET (1<<0)#define MAPF_IA_EMPTY_IF_UNDEF (1<<1)#define MAPF_SHOW_ARP (1<<2) +#define MAPF_SHOW_FAMILY (1<<3)const char *mroute_addr_print_ex (const struct mroute_addr *ma,const unsigned int flags,struct gc_arena *gc);
src/openvpn/multi.c +2 -2
@@ -3275,8 +3275,8 @@msg (D_MULTI_MEDIUM ,"peer %" PRIu32" (%s) floated from %s to %s" , mi->context.c2.tls_multi->peer_id,tls_common_name (mi->context.c2.tls_multi, false), -mroute_addr_print (&mi->real, &gc), -print_link_socket_actual (&m->top.c2.from, &gc)); +mroute_addr_print_ex (&mi->real,MAPF_SHOW_FAMILY , &gc), +mroute_addr_print_ex (&real,MAPF_SHOW_FAMILY , &gc));/* remove old address from hash table before changing address */ ASSERT (hash_remove (m->hash, &mi->real));
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 3
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset
[Openvpn-devel] [S] Change in openvpn[master]: add flag to print addresses in a consistent format during float
In reply to a message not in the archivecron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email )
Change subject: add flag to print addresses in a consistent format during float
......................................................................
add flag to print addresses in a consistent format during float
Introduce the MAPF_SHOW_FAMILY flag to prepend the address family to the address when printing an mroute_addr object, similar to print_sockaddr_ex(). This ensures that when logging a float operation, both the old and new addresses are printed in the same format:
$proto:[$family]$address:$port.
Note: when using this flag with an IPv4-mapped IPv6 address, the output will appear as: [AF_INET6]a.b.c.d
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg32345.html
---
M src/openvpn/mroute.c
M src/openvpn/mroute.h
M src/openvpn/multi.c
3 files changed, 11 insertions(+), 2 deletions(-)
src/openvpn/mroute.c +8 -0
@@ -415,6 +415,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET]" ); + }buf_printf (&out,"%s" ,print_in_addr_t (ntohl (maddr.v4.addr), (flags &MAPF_IA_EMPTY_IF_UNDEF ) ?IA_EMPTY_IF_UNDEF :0 , gc));if (maddr.type &MR_WITH_NETBITS )
@@ -442,6 +446,10 @@ {buf_printf (&out,"%s:" ,proto2ascii (maddr.proto,AF_INET6 , false)); } +if (flags &MAPF_SHOW_FAMILY ) + { +buf_printf (&out,"[AF_INET6]" ); + }if (IN6_IS_ADDR_V4MAPPED ( &maddr.v6.addr ) ) { buf_printf(&out, "%s", print_in_addr_t(maddr.v4mappedv6.addr,
src/openvpn/mroute.h +1 -0
@@ -150,6 +150,7 @@#define MAPF_SUBNET (1<<0)#define MAPF_IA_EMPTY_IF_UNDEF (1<<1)#define MAPF_SHOW_ARP (1<<2) +#define MAPF_SHOW_FAMILY (1<<3)const char *mroute_addr_print_ex (const struct mroute_addr *ma,const unsigned int flags,struct gc_arena *gc);
src/openvpn/multi.c +2 -2
@@ -3275,8 +3275,8 @@msg (D_MULTI_MEDIUM ,"peer %" PRIu32" (%s) floated from %s to %s" , mi->context.c2.tls_multi->peer_id,tls_common_name (mi->context.c2.tls_multi, false), -mroute_addr_print (&mi->real, &gc), -print_link_socket_actual (&m->top.c2.from, &gc)); +mroute_addr_print_ex (&mi->real,MAPF_SHOW_FAMILY , &gc), +mroute_addr_print_ex (&real,MAPF_SHOW_FAMILY , &gc));/* remove old address from hash table before changing address */ ASSERT (hash_remove (m->hash, &mi->real));
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1092?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I43cd3d564d8c6ad4e41de5a38130d90cb6778395
Gerrit-Change-Number: 1092
Gerrit-PatchSet: 3
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged